package com.rongke.enums;

/**
 * Created by bilibili on 2017/9/28.
 */
public enum UserTypeEnum {
    ORDINARY(1,"普通身份会员"),INTERNALSTAFF(2,"内部员工"),INTRODUCER(3,"介绍人"),CENTURION(4,"百夫长"),ChIEFCOMMANDER(5,"千夫长"),

    FRANCHISEE(6,"加盟商"),APPLYCENTURION(7,"申请百夫长");

    private Integer type;
    private String typeName;
    UserTypeEnum(Integer type, String typeName) {
        this.type = type;
        this.typeName = typeName;
    }
    /**
     * 根据type 获取typeName
     * @param type
     * @return
     */
    public static UserTypeEnum getUserTypeByType(Integer type) {
        for (UserTypeEnum userTypeEnum: values()) {
            if (userTypeEnum.getType().equals(type)) {
                return userTypeEnum;
            }
        }
        return null;
    }



    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }
}
